package com.ash.test.relation;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ash.relation.Address;
import com.ash.relation.Person;





public class MySpringTestRelation {

	@Test
	public void test() {
		// 使用"spring.xml"和"spring-mybatis.xml"这两个配置文件创建Spring上下文
		ApplicationContext ac = new ClassPathXmlApplicationContext(new String[] {"beans-relation.xml" });

		
//		Person p = (Person) ac.getBean("person");
//		System.out.println(p);
		
		Address adress = (Address) ac.getBean("address1");
		System.out.println(adress);

		Person p=(Person)ac.getBean("person");
		System.out.println(p);
		
	}

}
